<template>
  <div>
    <el-page-header @back="goBack"> </el-page-header>
    <br>
    <el-table
      stripe
      :row-style="{height:'45px'}"
      :cell-style="{padding:'0px'}"
      style="font-size: 14px;width: 100%"
      :header-cell-style="{background:'#eef1f6',color:'#606266'}"
      :data= userTable >
      <el-table-column
        prop="index"
        align="center"
        label="序号"
        width="80">
      </el-table-column>
      <el-table-column
        align="center"
        prop="department"
        label="学校"
        width="150"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="college"
        label="学院"
        width="120"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="stid"
        label="学号"
        width="130"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="tel"
        label="电话"
        width="150"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="province"
        label="省份"
        width="80"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="stname"
        label="姓名"
        width="80"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="stype"
        label="类型"
        width="90"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="year"
        label="入学年份"
        width="100"
        :show-overflow-tooltip='true' >
      </el-table-column>
      <el-table-column
        align="center"
        prop="create_time"
        label="注册时间"
        :show-overflow-tooltip='true' >
      </el-table-column>
    </el-table>
  </div>

</template>

<script>
    export default {
        name: "registerUser",
        created () {
            this.initData()
        },
        methods:{
            goBack () {
                this.$router.go(-1)
            },
            initData () {
                this.$axios.post("managementSystem/user/registerUser")
                    .then(data => {
                            if (data.status != 200) {
                                this.$message.error('服务出错' + data.status);
                            } else {
                                this.userTable=data.data.data;
                                for (var i in this.userTable) {
                                    this.userTable[i]["index"] = parseInt(i) + 1;
                                    if(this.userTable[i]["stype"]==2){
                                        this.userTable[i]["stype"] = '博士'
                                    }else if(this.userTable[i]["stype"] ==1){
                                        this.userTable[i]["stype"] = '硕士'
                                    }else if(this.userTable[i]["stype"] ==0){
                                        this.userTable[i]["stype"] = '本科'
                                    }else if(this.userTable[i]["stype"] ==3){
                                        this.userTable[i]["stype"] = '初中'
                                    }else if(this.userTable[i]["stype"] ==4){
                                        this.userTable[i]["stype"] = '高中'
                                    }else if(this.userTable[i]["stype"] ==5){
                                        this.userTable[i]["stype"] = '大专'
                                    }
                                }
                            }
                        }
                    )
            }
        },
        data() {
            return {
                userTable: [],
            }
        }
    }
</script>

<style scoped>

</style>
